package com.tech.connect.api;

import com.ksy.common.utils.CommonApiUtils;
import com.tech.connect.model.CatChoose;
import com.tech.connect.model.ItemCatSub;
import com.tech.connect.model.ItemJianLi;
import com.tech.connect.model.KeyWord;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;

public class JianLiHttp extends CommonApiUtils {
    public static Map<String, Object> getMap() {
        return new HashMap<>();
    }

    public interface ConnectApiServer {
        @POST("v1/talent/resume/conditions")
        Observable<BaseEntity<Map<String, List<ItemCatSub>>>> optChooseList();

        @POST("dictionary/occupation-category")
        Observable<BaseEntity<List<CatChoose>>> catChooseList();

        @POST("v1/talent/resume/list")
        Observable<BaseEntity<List<ItemJianLi>>> list(@Body Map<String, Object> map);

        @POST("keyword/talent-keyword")
        Observable<BaseEntity<List<KeyWord>>> keyWord();

        @POST("v1/talent/resume/create")
        Observable<BaseEntity<String>> create(@Body Map<String, Object> map);


    }

    public static Observable<BaseEntity<List<ItemJianLi>>> list(Map<String, Object> map, final BaseEntityOb<List<ItemJianLi>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).list(map));
    }

    public static Observable<BaseEntity<Map<String, List<ItemCatSub>>>> optChooseList(final BaseEntityOb<Map<String, List<ItemCatSub>>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).optChooseList());
    }

    public static Observable<BaseEntity<List<CatChoose>>> catChooseList(final BaseEntityOb<List<CatChoose>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).catChooseList());
    }

    public static Observable<BaseEntity<List<KeyWord>>> keyWord(final BaseEntityOb<List<KeyWord>> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).keyWord());
    }

    public static Observable<BaseEntity<String>> create(Map<String, Object> map, final BaseEntityOb<String> ob) {
        return ob.bindObed(ConnectApiManager.getApiServer(ConnectApiServer.class).create(map));
    }


}
